<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Bootstrap 101 Template</title>

    <!-- Bootstrap -->
    <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet">

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="http://cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="http://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>
<body>

<div class="container">
    <h1>留言板练习</h1>

    <table class="table table-hover">
        <thead>
        <tr>
            <th>#</th>
            <th>标题</th>
            <th>内容</th>
            <th>时间</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>

        <?php
            $result = mysql_query("select * from article");

            while($row = mysql_fetch_assoc($result)){
                print_r($row);
                echo "<br>";
        ?>

        <tr>
            <td><?php echo $row['id'];?></td>
            <td><?php echo $row['title'];?></td>
            <td><?php echo $row['content'];?></td>
            <td><?php echo date('Y:m:d H:i:s', $row['time']);?></td>
            <td>
                <a href="del.php?id=<?php echo $row['id'];?>">
                    <span class="glyphicon glyphicon-remove-sign"></span>
                </a>

                <a href="edit.php?id=<?php echo $row['id'];?>">
                    <span class="glyphicon glyphicon-plus-sign"></span>
                </a>
            </td>
        </tr>


        <?php }?>

        </tbody>
    </table>
    <form role="form" action="index.php" method="post" class="form-horizontal">
        <div class="form-group">
            <label for="title" class="col-sm-2 control-label">标题</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="title" placeholder="输入标题">
            </div>
        </div>
        <div class="form-group">
            <label for="content" class="col-sm-2 control-label">内容</label>
            <div class="col-sm-10">
                <textarea name="content" id="content" cols="20" rows="6" class="form-control" placeholder="请输入留言"></textarea>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <button type="submit"  class="btn btn-default ">发布</button>
            </div>
        </div>


    </form>
</div>
<script src="http://cdn.bootcss.com/jquery/1.11.1/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="bootstrap/js/bootstrap.min.js"></script>

</body>
</html>
